Post by xiao on Apr 3, 2020 22:45:41 GMT
Hello,
I was wondering if there's a way to do if/and or if/else statements by using nested ifs to create conditional feedback? This is currently what I'm using in my experiment (example below), but it still seems to be running through all the conditional statements. Thank you!
if @3 == 2 # if the bean is bad
if STATUS != CORRECT # AND user selects the bean
if &points < 10 # if user has 10 points or more, then decrease by 10; otherwise decrease points to 0
set &points 0
draw off
text color white
show text "DECISION: YES" 250 150
show text "EFFECT OF BEAN: -10" 250 200
show text "NET LOSS: -11" 250 250
draw on
delay 2000
clear screen
fi
if &points > 9
set &points decrease 10
draw off
text color white
show text "DECISION: YES" 250 150
show text "EFFECT OF BEAN: -10" 250 200
show text "NET LOSS: -11" 250 250
draw on
delay 2000
clear screen
fi
fi
if STATUS == CORRECT # ELSE they avoid the bean (AND bean is bad)
draw off
text color white
show text "DECISION: NO" 250 150
show text "EFFECT OF BEAN: NONE" 250 200
show text "NET LOSS: -1" 250 250
draw on
delay 2000
clear screen
fi
fi
I was wondering if there's a way to do if/and or if/else statements by using nested ifs to create conditional feedback? This is currently what I'm using in my experiment (example below), but it still seems to be running through all the conditional statements. Thank you!
if @3 == 2 # if the bean is bad
if STATUS != CORRECT # AND user selects the bean
if &points < 10 # if user has 10 points or more, then decrease by 10; otherwise decrease points to 0
set &points 0
draw off
text color white
show text "DECISION: YES" 250 150
show text "EFFECT OF BEAN: -10" 250 200
show text "NET LOSS: -11" 250 250
draw on
delay 2000
clear screen
fi
if &points > 9
set &points decrease 10
draw off
text color white
show text "DECISION: YES" 250 150
show text "EFFECT OF BEAN: -10" 250 200
show text "NET LOSS: -11" 250 250
draw on
delay 2000
clear screen
fi
fi
if STATUS == CORRECT # ELSE they avoid the bean (AND bean is bad)
draw off
text color white
show text "DECISION: NO" 250 150
show text "EFFECT OF BEAN: NONE" 250 200
show text "NET LOSS: -1" 250 250
draw on
delay 2000
clear screen
fi
fi